package com.test.kotlin02

fun main(){

    val getDiscountWords = { goodsName:String,hour:Int ->
        val currentYear = 2021
        "${currentYear}年双十一${goodsName}促销倒计时:$hour 小时"
    }
    showOnBoard("卫生纸",getDiscountWords)
}

fun  showOnBoard(goodsName:String,getDiscountWords2222:(String,Int) ->String){
    val hour:Int = (1..24).shuffled().last();
    println(getDiscountWords2222(goodsName,hour))
}


//inline fun   showOnBoard2inline( goodsName:String,getDiscountWords2222:(String,Int) ->String){
//    val hour:Int = (1..24).shuffled().last();
//    println(getDiscountWords2222(goodsName,hour))
//}
